#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	bool isNStraightHand(vector<int>& hand, int groupSize)
	{
		unordered_map<int, int> map;
		priority_queue<int> q;
		for (int num : hand) {
			map[num]++;
			q.emplace(num);
		}
		while (!q.empty()) {
			int t = q.top(); q.pop();
			if (!map[t]) continue;
			for (int i = 0; i < groupSize; i++) {
				if (!map[t - i]) return false;
				map[t - i]--;
			}
		}
		return true;
	}

private:
};

int main()
{
	[[maybe_unused]] Solution solution;
	return 0;
}
